home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga News 95
/
Amiga News 95.iso
/
dpat
/
dpat84
/
errormsg
/
examples
/
muiapp.s
< prev
next >
Wrap
Text File
|
1994-09-07
|
7KB
|
266 lines
opt ALINK
XREF _DoMethod
MR EQUR a4
TRUE EQU 1
include exec/execbase.i
include libraries/mui.i
include libraries/mui_lib.i
include libraries/errormsg.i
include libraries/errormsg_lib.i
Start move.l 4.w,a6
move.l ThisTask(a6),a4
tst.l pr_CLI(a4)
bne.s .FromCLI
lea pr_MsgPort(a4),a0
jsr _LVOWaitPort(a6)
lea pr_MsgPort(a4),a0
jsr _LVOGetMsg(a6)
move.l d0,WB.Startup
.FromCLI
lea MUIMasterName(pc),a1
move.l #MUIMASTER_VMIN,d0
jsr _LVOOpenLibrary(a6)
move.l d0,_MUIMasterBase
beq.s .exit
lea ErrorMsg.Name(pc),a1
moveq #3,d0
jsr _LVOOpenLibrary(a6)
move.l d0,ErrorMsg.Base
beq.s .CloseMUI
bsr InitGUI
beq.s .CloseERM
bsr.s ProcessMessages
bsr.s FreeGUI
.CloseERM
move.l ErrorMsg.Base(pc),a1
move.l 4.w,a6
jsr _LVOCloseLibrary(a6)
.CloseMUI
move.l _MUIMasterBase(pc),a1
move.l 4.w,a6
jsr _LVOCloseLibrary(a6)
.exit move.l WB.Startup(pc),d0
beq.s .ToCLI
move.l d0,a1
move.l 4.w,a6
jsr _LVOForbid(a6)
jsr _LVOReplyMsg(a6)
moveq #0,d0
.ToCLI rts
ProcessMessages
.Loop DoMethod App(pc),#MUIM_Application_Input,#MUISignals
cmp.l #MUIV_Application_ReturnID_Quit,d0
beq.s .Quit
move.l MUISignals(pc),d0
beq.s .Quit
move.l 4.w,a6
jsr _LVOWait(a6)
bra.s .Loop
.Quit rts
FreeGUI
move.l App(pc),a0
move.l _MUIMasterBase(pc),a6
jsr _LVOMUI_DisposeObject(a6)
rts
InitGUI
bsr GetTagSpace
beq .Ret
ApplicationObject
MUIT MUIA_HelpFile,HelpFile.Name
MUIT MUIA_HelpNode,Main.Name
MUIT MUIA_Application_Author,Author.Name
MUIT MUIA_Application_Base,App.Base
MUIT MUIA_Application_Copyright,App.Copyright
MUIT MUIA_Application_Description,App.Descr
MUIT MUIA_Application_Title,App.Title
MUIT MUIA_Application_Version,App.Version
SubWindowi
WindowObject
MUIT MUIA_Window_ID,"MAIN"
MUIT MUIA_Window_ScreenTitle,Window.ScrTitle
MUIT MUIA_Window_Title,Window.Title
WindowContentsi
VGroup
Childi HGroup
GroupFrameT HKGr.Title
Childi VGroup
MUIT MUIA_Weight,300
Childi ListviewObject
MUIT MUIA_Listview_List
ListObject
InputListFrame
Endi
Endi
Childi VGroup
MUIT MUIA_Group_Columns,2
Childi Label2,Nom.Name
Childi StringObject
StringFrame
Endi
is Nom.String
Childi Label2,Touche.Name
Childi StringObject
StringFrame
Endi
is Touche.String
Childi Label2,Commande.Name
Childi StringObject
StringFrame
Endi
is Commande.String
Endi
Endi
Childi VGroup
MUIT MUIA_Group_SameSize,TRUE
Childi SimpleButton,Premier.Name
Childi SimpleButton,Haut.Name
Childi SimpleButton,Bas.Name
Childi SimpleButton,Dernier.Name
Childi SimpleButton,Trier.Name
Childi SimpleButton,Creer.Name
Childi SimpleButton,Copier.Name
Childi SimpleButton,Effacer.Name
Endi
Endi
Childi HGroup
GroupFrame
MUIT MUIA_Group_SameSize,TRUE
Childi SimpleButton,Sauver.Name
Childi SimpleButton,Utiliser.Name
Childi SimpleButton,Tester.Name
Childi SimpleButton,Aide.Name
Childi SimpleButton,Annuler.Name
Endi
Endi
Endi
is MainWin
Endi
is App
beq .Fail
DoMethod App(pc),#MUIM_Application_Load,#MUIV_Application_Load_ENV
DoMethod MainWin(pc),#MUIM_Notify,#MUIA_Window_CloseRequest,#TRUE,App(pc),#2,#MUIM_Application_ReturnID,#MUIV_Application_ReturnID_Quit
DoMethod MainWin(pc),#MUIM_Set,#MUIA_Window_Open,#TRUE
; notification
DoMethod Nom.String(pc),#MUIM_Notify,#MUIA_String_Acknowledge,#MUIV_EveryTime,Nom.String(pc),#4,#MUIM_CallHook,#String.Hook,#Nom.Name,#MUIV_TriggerValue
DoMethod Touche.String(pc),#MUIM_Notify,#MUIA_String_Acknowledge,#MUIV_EveryTime,Touche.String(pc),#4,#MUIM_CallHook,#String.Hook,#Touche.Name,#MUIV_TriggerValue
DoMethod Commande.String(pc),#MUIM_Notify,#MUIA_String_Acknowledge,#MUIV_EveryTime,Commande.String(pc),#4,#MUIM_CallHook,#String.Hook,#Commande.Name,#MUIV_TriggerValue
bsr.s FreeTagSpace
moveq #-1,d0
.Ret rts
.Fail bsr.s FreeTagSpace
moveq #0,d0
rts
GetTagSpace
move.l #TAG_SPACE,d0
move.l #MEMF_PUBLIC,d1
move.l 4.w,a6
jsr _LVOAllocMem(a6)
move.l d0,MR
move.l d0,TagSpace
rts
FreeTagSpace
move.l TagSpace(pc),a1
move.l #TAG_SPACE,d0
move.l 4.w,a6
jsr _LVOFreeMem(a6)
rts
String.HookFunc
movem.l d0-d1/a0-a3/a6,-(sp)
lea String.Message(pc),a0
move.l sp,a3
clr.l -(sp)
pea StringMessage.Gad
pea EMT_GadFmt
pea StringMessage.Title
pea EMT_Title
move.l MainWin(pc),-(sp)
pea EMT_MUIWinObject
move.l App(pc),-(sp)
pea EMT_MUIAppObject
move.l _MUIMasterBase(pc),-(sp)
pea EMT_MUIBase
move.l sp,a2
move.l ErrorMsg.Base(pc),a6
jsr _LVODisplayMessageA(a6)
move.l a3,sp
movem.l (sp)+,d0-d1/a0-a3/a6
rts
String.Hook dc.l 0,0,String.HookFunc,0,0
_MUIMasterBase dc.l 0
ErrorMsg.Base dc.l 0
WB.Startup dc.l 0
TagSpace dc.l 0
Nom.String dc.l 0
Touche.String dc.l 0
Commande.String dc.l 0
MainWin dc.l 0
App dc.l 0
MUISignals dc.l 0
MUIMasterName dc.b 'muimaster.library',0
ErrorMsg.Name dc.b 'errormsg.library',0
HelpFile.Name dc.b 'Injector.Guide',0
Main.Name dc.b 'Main',0
Author.Name dc.b 'Frédéric Delacroix',0
App.Base dc.b 'InjectorPrefs',0
App.Copyright dc.b 'Copyright ©1993-94 F.Delacroix',0
App.Descr dc.b 'Injector Preferences',0
App.Title dc.b 'InjectorPrefs',0
App.Version dc.b '$VER: InjectorPrefs_MUI 2.05 (12.08.94)',0
Window.Title
Window.ScrTitle dc.b 'Injector 2.05 Copyright ©1993-94 F.Delacroix',0
HKGr.Title dc.b 'Defined hotkeys',0
Premier.Name dc.b 'Premier',0
Haut.Name dc.b 'Haut',0
Bas.Name dc.b 'Bas',0
Dernier.Name dc.b 'Dernier',0
Trier.Name dc.b 'Trier',0
Nom.Name dc.b 'Nom:',0
Creer.Name dc.b 'Créer',0
Touche.Name dc.b 'Touche:',0
Copier.Name dc.b 'Copier',0
Commande.Name dc.b 'Commande:',0
Effacer.Name dc.b 'Effacer',0
Sauver.Name dc.b 'Sauver',0
Utiliser.Name dc.b 'Utiliser',0
Tester.Name dc.b 'Tester',0
Aide.Name dc.b 'Aide',0
Annuler.Name dc.b 'Annuler',0
String.Message
dc.b 27,'cThis is little demo shows how to use MUI from errormsg.library',10
dc.b 'This interface is in no way functionnal, it is an old preview for',10
dc.b 'The MUI version of the preferences program for ',27,'uInjector',27,'n.'
dc.b 10,'(The interface has even changed a bit since)',10
dc.b 10,'You clicked on the gadget labelled: ',27,'i%s',27,'n',10
dc.b 'It now contains: %s',10
dc.b 10,'MUI users... don''t forget to register !',0
StringMessage.Gad dc.b '_Great!|',27,'c_Multiple',10,'Lines!|*Images:',27,'I[6:23](HardDisk)',0
StringMessage.Title dc.b 'Title of the nice MUI requester',0
include libraries/mui_asm.i